#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using namespace std;


void Test1()
{
    multiset<char> s1; multiset<char> s2;
    string str1, str2;
    cin >> str1 >> str2;
    for (int i = 0; i < str1.size(); i++)
    {
        s1.insert(str1[i]);
    }

    for (int i = 0; i < str2.size(); i++)
    {
        s2.insert(str2[i]);
    }

    auto it1 = s1.begin(), it2 = s2.begin();
    while(it1 != s1.end() && it2 != s2.end())
    {
        if (*it2 == *it1)
        {
            it2++;
            it1++;
        }
        else if (*it2 > *it1)
        {
            it1++;
        }
        else
        {
            cout << "No" << endl;
            break;
        }
    }
    if (it2 == s2.end()) { cout << "Yes" << endl; }
}

void Test2()
{
    int hx[200] = { 0 };
    string str1, str2;
    cin >> str1 >> str2;
    for (int i = 0; i < str1.size(); i++)
    {
        hx[str1[i]]++;
    }
    bool aaa = true;
    for (int i = 0; i < str2.size(); i++)
    {
        if (hx[str2[i]] != 0)
        {
            hx[str2[i]]--;
        }
        else
        {
            cout << "No" << endl;
            aaa = false;
            break;
        }
    }
    if (aaa) { cout << "Yes" << endl; }
}

void Test3()
{
    vector<int>  v;

    int n, x;
    cin >> n;
    for (int i = 0; i < (3 * n); i++)
    {
        cin >> x;
        v.push_back(x);
    }
    sort(v.begin(), v.end());

    int sum = 0, m = n;
    auto it = ++v.rbegin();
    while (m--)
    {
        sum += *it;
        it += 2;
    }
    cout << sum << endl;

}

int main()
{

	Test3();

	return 0;
}
